package com.example.day0702;

/**
 * @author Lenovo
 */
public class Student {
    String name;
//    int age;
    private int age;
    public void setAge(int a){
//
        if (a<0||a>120){
            System.out.println("年龄不合法");
        }else {
            age = a;
        }
        }


    public int getAge(){
        return age;
    }

    public void show(){
        System.out.println(name + "," + age);
    }
}
